package com.turing.post.transaction.util;

import java.math.BigInteger;
import java.util.Date;

import javax.ejb.Local;
import javax.ejb.Remote;

import com.turing.post.util.PCPSApplicationException;

/**
 * 商户交易子系统业务逻辑接口
 * 
 * @author yxb
 * @date 2012-12-17
 */
@Remote
@Local
public interface MrchBusiness {
	/**
	 * 获取有效的卡号
	 * 
	 * @param merchantNo
	 * @param cardNo
	 * @param track2
	 * @param track3
	 * @return
	 * @throws PCPSApplicationException
	 */
	public String getValidateCardNo(String merchantNo, String cardNo,
			String track2, String track3) throws PCPSApplicationException;

	/**
	 * 卡消费 mtp 商户交易参数对象
	 * 
	 * @throws PCPSApplicationException
	 *             异常信息
	 */
	public MrchTransParam Paid(MrchTransParam mtp)
			throws PCPSApplicationException;

	/**
	 * 卡消费 mtp 商户交易参数对象
	 * 
	 * @throws PCPSApplicationException
	 *             异常信息
	 */
	public MrchTransParam PaidCalcFee(MrchTransParam mtp)
			throws PCPSApplicationException;

	/**
	 * 卡消费冲正 mtp 商户交易参数对象
	 * 
	 * @throws PCPSApplicationException
	 *             异常信息
	 */
	public MrchTransParam PaidCorrect(MrchTransParam mtp)
			throws PCPSApplicationException;

	/**
	 * 卡消费撤销/退货 mtp 商户交易参数对象
	 * 
	 * @throws PCPSApplicationException
	 *             异常信息
	 */
	public MrchTransParam PaidCancel(MrchTransParam mtp)
			throws PCPSApplicationException;

	/**
	 * 校验撤销/退货密码
	 * 
	 * @param mtp
	 * @param cardNo
	 * @param pwd
	 * @throws PCPSApplicationException
	 */
	public void VerifyPaidCancel(MrchTransParam mtp, String cardNo, String pwd)
			throws PCPSApplicationException;

	/**
	 * 卡消费撤销冲正 mtp 商户交易参数对象
	 * 
	 * @throws PCPSApplicationException
	 *             异常信息
	 */
	public MrchTransParam PaidCancelCorr(MrchTransParam mtp)
			throws PCPSApplicationException;

	/**
	 * 卡充值验证 mtp 商户交易参数对象
	 * 
	 * @throws PCPSApplicationException
	 *             异常信息
	 */
	public MrchTransParam DepositValidate(MrchTransParam mtp)
			throws PCPSApplicationException;

	/**
	 * 卡充值确认 mtp 商户交易参数对象
	 * 
	 * @throws PCPSApplicationException
	 *             异常信息
	 */
	public MrchTransParam DepositConfirm(MrchTransParam mtp)
			throws PCPSApplicationException;

	/**
	 * 卡充值 mtp 商户交易参数对象
	 * 
	 * @throws PCPSApplicationException
	 *             异常信息
	 */
	public MrchTransParam Deposit(MrchTransParam mtp)
			throws PCPSApplicationException;

	/**
	 * 卡充值冲正 mtp 商户交易参数对象
	 * 
	 * @throws PCPSApplicationException
	 *             异常信息
	 */
	public MrchTransParam DepositCorrect(MrchTransParam mtp)
			throws PCPSApplicationException;

	/**
	 * 卡充值撤销 mtp 商户交易参数对象
	 * 
	 * @throws PCPSApplicationException
	 *             异常信息
	 */
	public MrchTransParam DepositCancel(MrchTransParam mtp)
			throws PCPSApplicationException;

	/**
	 * 卡充值撤销冲正 mtp 商户交易参数对象
	 * 
	 * @throws PCPSApplicationException
	 *             异常信息
	 */
	public MrchTransParam DepositCancelCorrect(MrchTransParam mtp)
			throws PCPSApplicationException;

	/**
	 * 商户对帐
	 * 
	 * @throws PCPSApplicationException
	 *             异常信息
	 */
	public MrchTransParam CheckAccount(MrchTransParam mtp)
			throws PCPSApplicationException;

	/**
	 * 手工调帐
	 * 
	 * @param adjustMerchantNo
	 *            待调帐商户号
	 * @param adjustTranSeqNo
	 *            待调帐流水号
	 * @param adjustTranDate
	 *            待调帐日期
	 * @param amount
	 *            原交易发生金额
	 * @param operId
	 *            调帐人ID
	 * @param remark
	 *            调帐备注
	 * @throws PCPSApplicationException
	 */
	public void AdjustAccount(String adjustMerchantNo, String adjustTranSeqNo,
			Date adjustTranDate, BigInteger amount, BigInteger operId,
			String remark) throws PCPSApplicationException;

	/**
	 * 商户交易差错处理
	 * 
	 * @param mmObj
	 * @return
	 * @throws PCPSApplicationException
	 */
	public MchMistakeObject MistakeAccount(MchMistakeObject mmObj)
			throws PCPSApplicationException;
}